function [data_random] = balance_scale_read(file_txt)
    % 读取Balance Scale数据集文件
    fid = fopen(file_txt, 'rt');
    
    % 初始化存储数组
    data_cells = {};
    labels = {};
    class_distribution = containers.Map({'L', 'B', 'R'}, {0, 0, 0});
    
    % 逐行读取数据
    line_count = 0;
    while ~feof(fid)
        line = fgetl(fid);
        if isempty(line)
            continue;  % 跳过空行
        end
        
        % 分割逗号分隔的数据
        parts = strsplit(line, ',');
        
        % 提取类别标签（第一列）
        class_label = parts{1};
        
        % 更新类别分布统计
        if isKey(class_distribution, class_label)
            class_distribution(class_label) = class_distribution(class_label) + 1;
        else
            class_distribution(class_label) = 1;
        end
        
        % 提取特征值（后4列）
        features = str2double(parts(2:end));
        
        % 存储数据
        data_cells = [data_cells; {class_label, features}];
        line_count = line_count + 1;
    end
    fclose(fid);
    
    % 创建数值标签映射
    label_mapping = containers.Map({'L', 'B', 'R'}, {1, 2, 3});
    
    % 创建数值矩阵
    num_data = zeros(line_count, 5);  % [标签, 左重量, 左距离, 右重量, 右距离]
    
    for i = 1:line_count
        class_label = data_cells{i, 1};
        features = data_cells{i, 2};
        
        % 转换标签为数值
        num_data(i, 1) = label_mapping(class_label);
        
        % 存储特征
        num_data(i, 2:5) = features;
    end
    
    % 获取数据集信息
    num_samples = size(num_data, 1);
    
    % 显示数据集统计信息
    fprintf('成功读取Balance Scale数据集: %s\n', file_txt);
    fprintf('样本数量: %d\n', num_samples);
    fprintf('特征数量: 4\n');
    
    % 显示类别分布
    fprintf('\n类别分布:\n');
    total_samples = num_samples;
    labels = keys(class_distribution);
    for i = 1:length(labels)
        label = labels{i};
        count = class_distribution(label);
        percent = (count / total_samples) * 100;
        fprintf('  %-5s: %d (%.2f%%)\n', label, count, percent);
    end
    
    % 显示特征值范围
    fprintf('\n特征值范围 (所有特征取值1-5):\n');
    feature_names = {'Left-Weight', 'Left-Distance', 'Right-Weight', 'Right-Distance'};
    for i = 1:4
        col = num_data(:, i+1);  % 跳过标签列
        fprintf('%-15s: min=%d, max=%d\n', feature_names{i}, min(col), max(col));
    end
    
    % 计算理论平衡点并验证分类规则
    fprintf('\n验证分类规则:\n');
    left_lever = num_data(:, 2) .* num_data(:, 3);  % 左重量 * 左距离
    right_lever = num_data(:, 4) .* num_data(:, 5); % 右重量 * 右距离
    
    % 根据规则预测类别
    predicted_labels = zeros(size(num_data, 1), 1);
    for i = 1:size(num_data, 1)
        if left_lever(i) > right_lever(i)
            predicted_labels(i) = 1;  % L
        elseif left_lever(i) < right_lever(i)
            predicted_labels(i) = 3;  % R
        else
            predicted_labels(i) = 2;  % B
        end
    end
    
    % 计算与实际标签的一致性
    accuracy = sum(predicted_labels == num_data(:, 1)) / num_samples * 100;
    fprintf('  分类规则与实际标签一致性: %.2f%%\n', accuracy);
    
    % 随机打乱数据
    random_indices = randperm(size(num_data, 1));
    data_random = num_data(random_indices, :);
end